package com.apigen.platform.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

/**
 * 系统用户DTO
 *
 * @author API Generator
 * @since 2024-09-24
 */
@Data
@Schema(description = "系统用户数据传输对象")
public class SysUserDTO {

    @Schema(description = "用户ID")
    private Long userId;

    @Schema(description = "账户名", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "账户名不能为空")
    @Size(min = 3, max = 50, message = "账户名长度必须在3-50个字符之间")
    @Pattern(regexp = "^[a-zA-Z0-9_]+$", message = "账户名只能包含字母、数字和下划线")
    private String accountName;

    @Schema(description = "昵称")
    @Size(max = 50, message = "昵称长度不能超过50个字符")
    private String nickName;

    @Schema(description = "密码")
    @Size(min = 6, max = 20, message = "密码长度必须在6-20个字符之间")
    private String userPassword;

    @Schema(description = "头像")
    private String avatar;

    @Schema(description = "邮箱")
    @Email(message = "邮箱格式不正确")
    @Size(max = 100, message = "邮箱长度不能超过100个字符")
    private String email;

    @Schema(description = "手机号")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确")
    private String phone;

    @Schema(description = "是否管理员")
    private Boolean isAdmin;

    @Schema(description = "是否启用")
    private Boolean isEnabled;

    @Schema(description = "优先级")
    private Integer priority;

    @Schema(description = "备注")
    @Size(max = 500, message = "备注长度不能超过500个字符")
    private String remark;
}